//只有ip信息，城市信息不正确
const soHuUrl = "//pv.sohu.com/cityjson?ie=utf-8"

/*
window.onload = function () {
    getIpLocationBySoHu(res => {
        saveWebVisit(res)
    })
}
*/

/**
 * 获取ip地址信息
 * @param callback 获取成功后回调方法
 */
function getIpLocationBySoHu(callback) {
    $.getScript(soHuUrl)
        .done(function (script, textStatus, jqxhr) {
            callback({
                address: "",
                city: returnCitySN.cname,
                ip: returnCitySN.cip,
            })
        })
        .fail(function () {
            callback({
                error: "加载IP地址失败",
                address: "",
                city: "",
                ip: "",
            })
        });
}


